package org.stone926.airschool.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.stone926.airschool.bean.Teacher;
import org.stone926.airschool.service.TeacherService;

@Controller
@RequestMapping("/teacher")
public class TeacherController {

	@Autowired
	private TeacherService teacherService;

	@ResponseBody
	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
	public Teacher getTeacherById(@PathVariable("id") Integer tid) {
		System.out.println("TeacherController recieve request, id=" + tid);
		return teacherService.getTeacherById(tid);
	}

}
